/*******************************************************************************
 * @project: ServletTest
 * @package: com.burns.servlet
 * @file: CheckBox.java
 * @author: Administrator
 * @created: 2017-5-17
 * @purpose:
 * 
 * @version: 1.0
 * 
 * Revision History at the end of file.
 * 
 * Copyright 2017 AcconSys All rights reserved.
 ******************************************************************************/

package com.burns.servlet;

//导入必需的 java 库
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

//扩展 HttpServlet 类
public class CheckBox extends HttpServlet {

	// 处理 GET 方法请求的方法
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		// 设置响应内容类型
		response.setHeader("content-type", "text/html;charset=UTF-8");
		response.setContentType("text/html");

		PrintWriter out = response.getWriter();
		String title = "读取复选框数据";
		String docType = "<!doctype html public \"-//w3c//dtd html 4.0 "
				+ "transitional//en\">\n";
		out.println(docType + "<html>\n" + "<head><title>" + title
				+ "</title></head>\n" + "<body bgcolor=\"#f0f0f0\">\n"
				+ "<h1 align=\"center\">" + title + "</h1>\n" + "<ul>\n"
				+ "  <li><b>数学标识：</b>: " + request.getParameter("maths") + "\n"
				+ "  <li><b>物理标识：</b>: " + request.getParameter("physics")
				+ "\n" + "  <li><b>化学标识：</b>: "
				+ request.getParameter("chemistry") + "\n" + "</ul>\n"
				+ "</body></html>");
	}

	// 处理 POST 方法请求的方法
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}
}

/*******************************************************************************
 * <B>Revision History</B><BR>
 * [type 'revision' and press Alt + / to insert revision block]<BR>
 * 
 * 
 * 
 * Copyright 2017 AcconSys All rights reserved.
 ******************************************************************************/
